<?php
if (!isAjaxRequest()) {
    global $tip;
    $tip = get_get("tip");
    loadTemp("system/login.temp.php");
    die();
}

if (get_post("op") == "login") {
    $passwd = get_post("passwd");
    if (strlen($passwd) < 6) {
        die(returnMessage(1, "密码长度应当大于6位"));
    }
    $account = get_post("account");
    if ($account == "") {
        die(returnMessage(2, "账户不能为空"));
    }

    $backcode = login($account, $passwd);
    switch ($backcode) {
        case - 1:
            die(returnMessage(- 1, "账户不存在"));
        case - 2:
            die(returnMessage(- 2, "密码错误"));
        case - 3:
            die(returnMessage(- 3, "banned"));
        case 1:
            die(returnMessage("3", "已经登录过了"));
    }
    die(returnMessage(0, "登录成功"));
    return;
}


?>